package entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class RedemptionRecord extends BaseEntity {
	private String recordID;
	private Date recordDate;
	private String reponsibleStaffName;
	private String memberID;
	private int nRedempted;
	private int ptnCharged;
	
	public RedemptionRecord(String basicRecordData) throws ParseException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
		String[] attrVal = basicRecordData.split(" ");
		this.setRecordID(attrVal[0]);

		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd");
		this.setRecordDate(formatter.parse(attrVal[1]));
		this.setReponsibleStaffName(attrVal[2]);
		this.setMemberID(attrVal[3]);
		this.setnRedempted(Integer.valueOf(attrVal[4]));
		this.setPtnCharged(Integer.valueOf(attrVal[5]));
	}
	
	public RedemptionRecord(String newRecordID, Date date, String staffName, String memberID, int nCoupon, int pointUsed) {
		this.setRecordID(newRecordID);
		this.setRecordDate(date);
		this.setReponsibleStaffName(staffName);
		this.setMemberID(memberID);
		this.setnRedempted(nCoupon);
		this.setPtnCharged(pointUsed);
	}

	public String getReponsibleStaffName() {
		return reponsibleStaffName;
	}

	public void setReponsibleStaffName(String reponsibleStaffName) {
		this.reponsibleStaffName = reponsibleStaffName;
	}

	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public String getRecordID() {
		return recordID;
	}

	public void setRecordID(String recordID) {
		this.recordID = recordID;
	}

	public String getMemberID() {
		return memberID;
	}

	public void setMemberID(String memberID) {
		this.memberID = memberID;
	}

	public int getnRedempted() {
		return nRedempted;
	}

	public void setnRedempted(int nRedempted) {
		this.nRedempted = nRedempted;
	}

	public int getPtnCharged() {
		return ptnCharged;
	}

	public void setPtnCharged(int ptnCharged) {
		this.ptnCharged = ptnCharged;
	}

}
